﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:System="clr-namespace:System;assembly=mscorlib"
		xmlns:ext="clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell"
		xmlns:primitives="clr-namespace:Microsoft.Windows.Controls.Ribbon.Primitives;assembly=RibbonControlsLibrary"
		xmlns:Ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
		xmlns:local="clr-namespace:Daytimer.Styles">
	<Style TargetType="Ribbon:RibbonContextMenu" BasedOn="{StaticResource ContextMenuKey}" />
	<Style TargetType="Ribbon:RibbonMenuItem" BasedOn="{StaticResource MenuItemKey}" />
	<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
	<Style TargetType="Ribbon:Ribbon">
		<Setter Property="TextOptions.TextFormattingMode" Value="Display" />
		<Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
		<Setter Property="FontFamily" Value="Segoe UI, /Daytimer.Fonts;component/#WeblySleek UI Normal" />
		<Setter Property="FontSize" Value="12" />
		<Setter Property="FontWeight" Value="Normal" />
		<Setter Property="Foreground" Value="{DynamicResource Black}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Ribbon:Ribbon">
					<Grid SnapsToDevicePixels="True" Background="{TemplateBinding Background}">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition Height="Auto" />
							<RowDefinition Height="Auto" />
							<RowDefinition Height="Auto" />
						</Grid.RowDefinitions>
						<primitives:RibbonTitlePanel x:Name="PART_TitlePanel" Grid.ColumnSpan="3" Margin="27,0,145,0"
								HorizontalAlignment="Stretch" ClipToBounds="False">
							<Border x:Name="QatTopHost">
								<ContentPresenter x:Name="QatTopHostContentPresenter"
										Content="{TemplateBinding QuickAccessToolBar}" IsHitTestVisible="True"
										Margin="0,-1,0,1" />
							</Border>
							<ContentPresenter x:Name="PART_TitleHost" ContentSource="Title"
									ContentTemplate="{TemplateBinding TitleTemplate}" TextBlock.FontSize="12"
									TextBlock.FontFamily="Segoe UI, /Daytimer.Fonts;component/#WeblySleek UI Normal"
									TextBlock.FontWeight="Normal"
									TextElement.Foreground="{DynamicResource WindowCaptionUnfocused}"
									HorizontalAlignment="Stretch" Margin="2,0" MinHeight="22" MinWidth="75"
									IsHitTestVisible="False">
								<ContentPresenter.Resources>
									<DataTemplate DataType="{x:Type System:String}">
										<TextBlock Text="{TemplateBinding Content}" TextTrimming="CharacterEllipsis"
												HorizontalAlignment="Stretch" TextAlignment="Center" />
									</DataTemplate>
								</ContentPresenter.Resources>
							</ContentPresenter>
							<Ribbon:RibbonContextualTabGroupItemsControl x:Name="PART_ContextualTabGroupItemsControl"
									IsHitTestVisible="True" ext:WindowChrome.IsHitTestVisibleInChrome="True"
									HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,0,0,-2" />
						</primitives:RibbonTitlePanel>
						<Border x:Name="UnderlineBorder" Grid.Row="1" BorderThickness="0,0,0,1"
								BorderBrush="{TemplateBinding BorderBrush}" Grid.ColumnSpan="3" Visibility="Hidden"
								Margin="0,-1,0,1" IsHitTestVisible="False" />
						<Border Grid.ColumnSpan="3" Grid.Row="1" Margin="0,-1,0,1">
							<Popup x:Name="PART_ITEMSPRESENTERPOPUP" AllowsTransparency="True" PopupAnimation="None"
									IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}">
								<Border ClipToBounds="True">
									<Grid x:Name="CollapsedPopupBackgroundBorder" Background="{DynamicResource White}"
											ClipToBounds="True" RenderTransformOrigin="0.5,0.5"
											SnapsToDevicePixels="False">
										<Grid.ColumnDefinitions>
											<ColumnDefinition Width="*" />
											<ColumnDefinition Width="Auto" />
										</Grid.ColumnDefinitions>
										<Grid.CacheMode>
											<BitmapCache SnapsToDevicePixels="False" />
										</Grid.CacheMode>
										<Grid.RenderTransform>
											<TranslateTransform x:Name="CollapsedPopupBackgroundBorderTransform" Y="-94" />
										</Grid.RenderTransform>
										<ContentControl x:Name="popupItemsPresenterHost"
												KeyboardNavigation.DirectionalNavigation="Cycle" Focusable="False"
												KeyboardNavigation.TabNavigation="Cycle" />
										<Border BorderThickness="0,0,0,1" BorderBrush="{TemplateBinding BorderBrush}"
												Grid.Column="1" IsHitTestVisible="False" />
										<Button x:Name="pinribbonbutton" Style="{DynamicResource RibbonCommandsButton}"
												Command="Ribbon:RibbonCommands.MaximizeRibbonCommand" Grid.Column="1"
												Margin="0,0,0,1">
											<Button.ToolTip>
												<Ribbon:RibbonToolTip Title="Pin the ribbon (Ctrl+F1)"
														Description="Like seeing the ribbon? Keep it open while you work." />
											</Button.ToolTip>
											<Image IsHitTestVisible="False" Stretch="None" Margin="9,5,10,4"
													Source="pack://application:,,,/Daytimer.Images;component/Images/pinribbon.png" />
										</Button>
									</Grid>
								</Border>
							</Popup>
						</Border>
						<ContentControl x:Name="mainItemsPresenterHost" Grid.ColumnSpan="3" Focusable="False"
								Grid.Row="2" ClipToBounds="True" Margin="0,-1,0,1">
							<Border x:Name="groupsBorder" BorderBrush="{TemplateBinding BorderBrush}"
									BorderThickness="0,0,0,1" Height="92" SnapsToDevicePixels="False"
									RenderTransformOrigin="0.5,0.5" Background="{DynamicResource White}">
								<Border.RenderTransform>
									<TranslateTransform x:Name="groupsBorderTransform" Y="-94" />
								</Border.RenderTransform>
								<Border.CacheMode>
									<BitmapCache SnapsToDevicePixels="False" />
								</Border.CacheMode>
								<Grid Background="Transparent" ext:WindowChrome.IsHitTestVisibleInChrome="True"
										Margin="0,0,8,0">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="*" />
										<ColumnDefinition Width="Auto" />
									</Grid.ColumnDefinitions>
									<ItemsPresenter x:Name="ItemsPresenter" />
									<Button x:Name="hideribbonbutton" Style="{StaticResource RibbonCommandsButton}"
											Command="Ribbon:RibbonCommands.MinimizeRibbonCommand" Grid.Column="1"
											Margin="2,0,-8,0">
										<Button.ToolTip>
											<!-- Unpin the ribbon (Ctrl+F1) -->
											<Ribbon:RibbonToolTip Title="Collapse the ribbon (Ctrl+F1)"
													Description="Need a bit more space? Collapse the ribbon so only the tab names show." />
											<!--Feeling cluttered? Put the ribbon away so that only the tabs show.-->
										</Button.ToolTip>
										<Image IsHitTestVisible="False" Stretch="None" Margin="10,6,10,5"
												Source="pack://application:,,,/Daytimer.Images;component/Images/hideribbon.png" />
									</Button>
								</Grid>
							</Border>
						</ContentControl>
						<Border x:Name="QatBottomHost" Grid.ColumnSpan="3" Grid.Row="3" Height="28"
								BorderBrush="{TemplateBinding BorderBrush}">
							<ContentPresenter x:Name="QatBottomHostContentPresenter" HorizontalAlignment="Left"
									IsHitTestVisible="True" VerticalAlignment="Center" Margin="-9,0,0,3" />
						</Border>
						<ContentPresenter x:Name="applicationMenu" Content="{TemplateBinding ApplicationMenu}"
								Grid.Row="1" VerticalAlignment="Top" Margin="0,6,0,0" />
						<Ribbon:RibbonTabHeaderItemsControl x:Name="TabHeaderItemsControl" Grid.Column="1"
								HorizontalAlignment="Left" Margin="1,6,1,1" Grid.Row="1" VerticalAlignment="Top" />
						<!--<ContentPresenter x:Name="PART_HelpPane"
								ContentTemplate="{TemplateBinding HelpPaneContentTemplate}"
								Content="{TemplateBinding HelpPaneContent}" Grid.Column="2"
								ContentSource="HelpPaneContent" HorizontalAlignment="Right" Grid.Row="1"
								VerticalAlignment="Top" />-->
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsCollapsed" Value="True">
							<Setter Property="Visibility" Value="Collapsed" TargetName="applicationMenu" />
							<Setter Property="Visibility" Value="Collapsed" TargetName="QatBottomHost" />
							<Setter Property="Visibility" Value="Collapsed" TargetName="QatTopHost" />
							<Setter Property="Visibility" Value="Collapsed" TargetName="mainItemsPresenterHost" />
							<Setter Property="Visibility" Value="Collapsed" TargetName="TabHeaderItemsControl" />
							<!--<Setter Property="Visibility" Value="Collapsed" TargetName="PART_HelpPane" />-->
							<Setter Property="Visibility" Value="Collapsed"
									TargetName="PART_ContextualTabGroupItemsControl" />
							<Setter Property="MinWidth" Value="0" TargetName="PART_TitleHost" />
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsCollapsed" Value="True" />
								<Condition Property="IsHostedInRibbonWindow" Value="False" />
							</MultiTrigger.Conditions>
							<Setter Property="Visibility" Value="Collapsed" />
						</MultiTrigger>
						<Trigger Property="ShowQuickAccessToolBarOnTop" Value="False">
							<Setter Property="Content" Value="{x:Null}" TargetName="QatTopHostContentPresenter" />
							<Setter Property="Visibility" Value="Collapsed" TargetName="QatTopHost" />
							<Setter Property="Content" TargetName="QatBottomHostContentPresenter"
									Value="{Binding QuickAccessToolBar, RelativeSource={RelativeSource TemplatedParent}}" />
						</Trigger>
						<MultiDataTrigger>
							<MultiDataTrigger.Conditions>
								<Condition
										Binding="{Binding RelativeSource={RelativeSource Self}, Path=QuickAccessToolBar.HasItems}"
										Value="False" />
								<Condition
										Binding="{Binding RelativeSource={RelativeSource Self}, Path=QuickAccessToolBar.CustomizeMenuButton}"
										Value="{x:Null}" />
							</MultiDataTrigger.Conditions>
							<Setter Property="Visibility" Value="Collapsed" TargetName="QatTopHost" />
							<Setter Property="Visibility" Value="Collapsed" TargetName="QatBottomHost" />
						</MultiDataTrigger>
						<Trigger Property="IsMinimized" Value="True">
							<Setter Property="Content" TargetName="mainItemsPresenterHost" Value="{x:Null}" />
							<Setter Property="Visibility" TargetName="mainItemsPresenterHost" Value="Collapsed" />
							<Setter Property="Content" TargetName="popupItemsPresenterHost"
									Value="{Binding ElementName=groupsBorder}" />
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMinimized" Value="True" />
								<Condition Property="ShowQuickAccessToolBarOnTop" Value="False" />
							</MultiTrigger.Conditions>
							<Setter Property="Height" TargetName="QatBottomHost" Value="28" />
							<Setter Property="Margin" TargetName="QatBottomHost" Value="0,5,0,0" />
							<Setter Property="Margin" TargetName="QatBottomHostContentPresenter" Value="-9,0,0,4" />
						</MultiTrigger>
						<Trigger Property="ShowQuickAccessToolBarOnTop" Value="True">
							<Setter Property="Visibility" TargetName="QatBottomHost" Value="Collapsed" />
						</Trigger>
						<Trigger Property="IsDropDownOpen" Value="True">
							<Setter Property="Visibility" TargetName="UnderlineBorder" Value="Visible" />
							<Setter Property="Visibility" TargetName="hideribbonbutton" Value="Hidden" />
							<Trigger.EnterActions>
								<BeginStoryboard>
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="CollapsedPopupBackgroundBorderTransform"
												Storyboard.TargetProperty="Y" From="-94" To="0" Duration="0:0:0.5">
											<DoubleAnimation.EasingFunction>
												<QuarticEase EasingMode="EaseOut" />
											</DoubleAnimation.EasingFunction>
										</DoubleAnimation>
									</Storyboard>
								</BeginStoryboard>
							</Trigger.EnterActions>
						</Trigger>
						<Trigger Property="IsDropDownOpen" Value="False">
							<Setter Property="PopupAnimation" TargetName="PART_ITEMSPRESENTERPOPUP" Value="Fade" />
						</Trigger>
						<Trigger Property="IsMinimized" Value="False">
							<Setter Property="Visibility" TargetName="UnderlineBorder" Value="Visible" />
							<Trigger.EnterActions>
								<BeginStoryboard>
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="groupsBorderTransform"
												Storyboard.TargetProperty="Y" From="-94" To="0" Duration="0:0:0.5">
											<DoubleAnimation.EasingFunction>
												<QuarticEase EasingMode="EaseOut" />
											</DoubleAnimation.EasingFunction>
										</DoubleAnimation>
									</Storyboard>
								</BeginStoryboard>
							</Trigger.EnterActions>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>